﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/base.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-2.1.1.min.js"></script>
    <script src="~/Content/bootstrap/js/bootstrap.js"></script>
    <script src="~/Scripts/layer/layer.js"></script>
    <link href="~/Scripts/Date/css/mobiscroll.css" rel="stylesheet" />
    <link href="~/Scripts/Date/css/mobiscroll_date.css" rel="stylesheet" />
    <script src="~/Scripts/Date/js/mobiscroll_date.js" charset="gb2312"></script>
    <script src="~/Scripts/Date/js/mobiscroll.js"></script>
    <title>邀请</title>
    <style type="text/css">
        body {
            font-family: arial, '宋体';
            background: #f2f2f2;
        }

        .container-fluid {
            margin: 0;
            padding: 0;
            text-align: center;
        }

        .btn_ok {
            background-color: #F3A433;
            border: none;
            color: white;
        }

        #update_pass {
            background-color: #F3A433;
            text-align: center;
            font-weight: bold;
            font-size: 20px;
            width: 100%;
            height: 60px;
            line-height: 60px;
        }

        #txt_password {
            margin-top: 15%;
        }

        .container-fluid {
            margin: 0;
            padding: 0;
        }
        #content_sel {
            text-align:left;
        }
        .layui-layer-molv .layui-layer-title {
            background-color: #F3A433;
        }
        .layui-layer-molv .layui-layer-btn a {
            background-color: #F3A433;
        }
        .layui-layer-btn .layui-layer-btn0 {
         border:0px;
        }
         .layui-layer-molv .layui-layer-btn .layui-layer-btn1 {
            background-color: #F3A433;
        }
    </style>
    <script>
        $(function () {
            GetLevel();
        })
        //添加
        function Opeas() {
            layer.open({
                type: 1,
                btn: ['确定', '取消'],
                title: '选择等级',
                skin: "layui-layer-molv",
                area: ['250px', '200px'],
                shade: 0.3,
                content: $('#content_sel'),
                btn1: function () {
                    var level = $("#sel_level").val();
                    var level_name = $('#sel_level').find("option:selected").text();
                    if (level == -1) {
                        layer.msg("请选择级别!");
                        return false;
                    }
                    var category_ids='@ViewData["category_id"]';
                        $.ajax({
                            type: "POST",
                            url: "/WechartShare/opeq_share",
                            dataType: "json",
                            data: { "level": level, "level_name": level_name, "category_id": category_ids },
                            success: function (data) {
                                //  layer.alert(JSON.stringify(data));
                                if (data.MessageCode == "0") {
                                    window.location.href = "/Share/Index?nonceStr=" + data.nonceStr;
                                
                                } else {
                                    layer.msg("分享失败!");

                                }
                            }
                        });
                    
                },
                btn2: function () {
                    layer.close();
                }
            })
        }
        function GetLevel() {
            $("#sel_level").html("<option value=\"-1\" code=\"0\">请选择</option>");
            $.ajax({
                type: "GET",
                url: "/WechartShare/GetLevelName",
                dataType: "json",
                data: {},
                success: function (data) {
                    if (data.list != "") {
                        $.each(data.list, function (i, n) {
                            $("#sel_level").append("<option value='" + n.id + "' coding=\"" + n.coding + "\">" + n.name + "</option>");
                        });
                    }
                }
            });
        }
    </script>
</head>
<body>
    <input type="text" value="@ViewData["share_state"]" />
      <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12" id="update_pass">
                <span style="text-align:center;color:white;">邀请新用户</span>
            </div>
        </div>
        </div>
        @{
            if (@ViewData["share_state"].ToString() == "1")
            {

                <div class="container-fluid">
                    <div class="row-fluid">
                        <div class="span12" style="background:white;">
                            <div class="span7" style="text-align: left; height: 80px; line-height: 80px;">
                                <div style="line-height: 40px; ">
                                    @{
                if (@Model != null)
                {
                    <span>@Model.name</span><br />
                                        <span>@Model.level_name</span><br />
                }

                                    }

                                </div>
                            </div>
                            <div class="span5" style=" height: 80px; line-height: 80px;">
                                <input type="button" value="邀请新代理" onclick="Opeas();" style="background-color: #F3A433;color:white; height:35px; border:0px; border-radius:4px;" />

                            </div>
                        </div>
                    </div>


                </div>
                <div id="content_sel" style="display:none; text-align:left;">
                    <div class="row-fluid">
                        <div class="span12" style=" margin-top:10px; text-align:center;">
                            <select id="sel_level" style="width:200px;">
                                <option value="-1">请选择</option>
                            </select>
                        </div>
                    </div>

                </div>

                <div id="sharePic" class="sharePic" style="display:none;">
                    <img src="~/Content/images/share.png" />
                </div>

            }
            else
            {
     <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12" style="margin-top:20px;">
                <span style="text-align:center;">您没有权限</span>
            </div>
        </div>
        </div>
            }
        }

        <div class="serp_quick_but">
            <a id="ab" class="quick_menu"></a>
            <a href="../Home/Index" id="a1" class="quick_menu_back small"><span>首页</span></a>
            <a href="../Certificate/Index" id="a2" class="quick_menu_fahuo small"><span>证书</span></a>
            <a href="../Examine/Index" id="a4" class="quick_menu_clienk small"><span>用户</span></a>
            <a href="../WechartShare/Index" id="a4" class="quick_menu_clienk small"><span>邀请</span></a>
            <a href="../Sqauthorization/Index" id="a3" class="quick_menu_shaom small"><span>申请</span></a>
            <a href="../Password/Index" id="a4" class="quick_menu_clienk small"><span>密码</span></a>
            <a href="../Login/ClearSession" id="a5" class="quick_menu_follow small"><span>退出</span></a>
        </div>
        <style type="text/css">
            .sharePic {
                display: none;
                position: fixed;
                top: 0;
                left: 0;
                z-index: 2000;
                width: 100%;
                height: 100%;
                background-color: rgba(0,0,0,0.5);
                text-align: right;
            }

                .sharePic.on {
                    display: block;
                }

                .sharePic img {
                    margin-top: 10px;
                    margin-right: 30px;
                    width: 160px;
                }

            .serp_quick_but {
                position: fixed;
                width: 300px;
                height: 60px;
                bottom: 0px;
                right: 5px;
            }

                .serp_quick_but a {
                    display: block;
                    position: absolute;
                    text-align: center;
                    text-decoration: none;
                }

                    .serp_quick_but a span {
                        font-size: 12px;
                        line-height: 94px;
                        color: #000;
                    }

            a.small {
                width: 36px;
                height: 36px;
                background: #d5d5d5;
                border-radius: 30px;
                border: 2px solid #fff;
                background: url(../Content/images/pic02.png) no-repeat rgba(0,0,0,0.4);
                background-size: auto 70px;
            }

            a:hover.small {
                border: 2px solid #fc4e2b;
                background: #fff;
            }

            .serp_quick_but a.quick_menu {
                right: 5px;
                top: -5px;
                width: 40px;
                height: 40px;
                background: url(../Content/images/pic02.png) no-repeat;
                background-size: auto 40px;
            }

            .serp_quick_but a.quick_menu_back {
                right: 55px;
                top: -5px;
                background-position: -69px -18px;
                display: none;
            }

            .serp_quick_but a.quick_menu_fahuo {
                right: 105px;
                top: -5px;
                background-position: -100px -18px;
                display: none;
            }

            .serp_quick_but a.quick_menu_shaom {
                right: 155px;
                top: -5px;
                background-position: -137px -18px;
                display: none;
            }

            .serp_quick_but a.quick_menu_clienk {
                right: 205px;
                top: -5px;
                background-position: -169px -18px;
                display: none;
            }

            .serp_quick_but a.quick_menu_follow {
                right: 255px;
                top: -5px;
                background-position: -209px -18px;
                display: none;
            }
        </style>
        <script>
            //左下方导航
            $(function () {
                var i = 0;
                $("#ab").click(function () {
                    i++;
                    if (i % 2 == 0) {
                        $("#a1").hide();
                        $("#a2").hide();
                        $("#a3").hide();
                        $("#a4").hide();
                        $("#a5").hide();
                    }
                    else {
                        $("#a1").show();
                        $("#a2").show();
                        $("#a3").show();
                        $("#a4").show();
                        $("#a5").show();
                    }
                })
            })
        </script>
</body>
</html>
